/*
 * @Author: yxw
 * @Date: 2019-02-25 14:24:17
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2019-02-25 15:50:39
 * @Description: 清单管理相关api
 */

import request from '@/router/axios'
import {detailListUrls} from '@/const/apiUrl'

/**
 * 清单列表查询
 * @param {*} query
 */
export function listTask (query) {
  return request({
    url: detailListUrls.listTask,
    method: 'get',
    params: query
  })
}

/**
 * 清单列表查询
 * @param {*} query
 */
export function getProtocolList (query) {
  return request({
    url: detailListUrls.getProtocolList,
    method: 'get',
    params: query
  })
}

export function getProtocolListTrack (query) {
  return request({
    url: detailListUrls.getProtocolListTrack,
    method: 'get',
    params: query
  })
}

/**
 * 清单详情查询
 * @param {*} query
 */
export function getList (query) {
  return request({
    url: detailListUrls.getList,
    method: 'get',
    params: query
  })
}


/**
 * 清单拟定暂存的提交
 * @param {*} query
 */
export function commitList (id) {
  return request({
    url: detailListUrls.commitList+id,
    method: 'get',
    params: id
  })
}


export function listInquire (query) {
  return request({
    url: detailListUrls.listInquire,
    method: 'get',
    params: query
  })
}


/**
 * 清单拟定暂存
 */
export function protocolAdd (obj) {
  return request({
    url: detailListUrls.protocolAdd,
    method: 'post',
    data: obj
  })
}

/**
 * 清单拟定保存并提交
 */
export function protocolsubmit (obj) {
  return request({
    url: detailListUrls.protocolsubmit,
    method: 'post',
    data: obj
  })
}

/**
 * 清单编辑
 */
export function protocolEdit (obj) {
  return request({
    url: detailListUrls.protocolEdit+obj.id,
    method: 'put',
    data: obj.projectform
  })
}

/**
 * 清单编辑
 */
export function protocolEditsubmit (obj) {
  return request({
    url: detailListUrls.protocolEditsubmit+obj.id,
    method: 'put',
    data: obj.projectform
  })
}


/**
 * 清单详情查询
 * @param {*} query
 */
export function getbasisinfo (id) {
  return request({
    url: detailListUrls.getbasisinfo+id,
    method: 'get',
  })
}

/**
 * 清单审核
 */
export function planningListCheck(taskId, params) {
  return request({
    url: detailListUrls.planningListCheck + taskId,
    method: 'put',
    data: params,
  })
}

/**
 * 发改委确认
 */
export function listconfirm (obj) {
  return request({
    url: detailListUrls.listconfirm+obj.id,
    method: 'put',
    data: obj.listopinion,
  })
}


/**
 * 清单批复
 */
export function submitReply (obj) {
  return request({
    url: detailListUrls.submitReply + obj.taskid,
    method: 'put',
    data: obj,
  })
}

/**
 * 清单上报
 */
export function listReport (id) {
  return request({
    url: detailListUrls.listReport + id,
    method: 'put'
  })
}

/**
 * 清单不上报政府直接结束
 */
export function notReport (id) {
  return request({
    url: detailListUrls.notReport + id,
    method: 'put'
  })
}

/**
 * 导出待办清单信息
 * @param {*}
 * @param {*}
 */
export function exportToDoDetailedData () {
  return request({
    url: detailListUrls.exportToDoDetailedData,
    method: 'get',
    responseType: 'blob'
  })
}

/**
 * 导出待办清单信息excel
 * @param {*}
 * @param {*}
 */
export function exportToDoDetailedDataExcel () {
  return request({
    url: detailListUrls.exportToDoDetailedDataExcel,
    method: 'get',
    responseType: 'blob'
  })
}
